
Page({
data: {
  items:'',
  money:''
},

addItem: function() {

  wx.navigateTo({ 
    url: '../NewAccounts/NewAccounts'

  })
},
  onShow: function () {
    let tableID = 37774
    let Product = new wx.BaaS.TableObject(tableID)
    
    Product.find().then(res => {
      this.setData({
        money: res.data.objects[res.data.objects.length-1].remain
      })
    }, err => {
      wx.showModal({
        title: '当前数据库为空！',
      })
    })
    Product.orderBy('-date').find().then(res => {
      this.setData({
        items: res.data.objects,
      })
    }, err => { })

  }



})
